package com.ls.socketio.repository.dao;

import com.ls.socketio.bean.RoomEnvInfo;
import com.ls.socketio.repository.RoomEnvRepository;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author liShan
 * @date 2019/9/6 0:25
 */
@Component
public class RoomEnvRepositoryImpl {

    @Resource
    private RoomEnvRepository roomEnvRepository;

    /**
     * 保存
     * @param info 信息
     */
    public void add(RoomEnvInfo info){
        roomEnvRepository.save(info);
    }

    /**
     * 根据房间id查询
     * @param roomId 房间id
     * @return 查询结果
     */
    public RoomEnvInfo findByRoomId(Long roomId){
        return roomEnvRepository.findByRoomId(roomId);
    }

}
